default namespace = "http://www.liquibase.org/xml/ns/dbchangelog"
namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
namespace ns_1 = "http://relaxng.org/ns/compatibility/annotations/1.0"
namespace rng = "http://relaxng.org/ns/structure/1.0"
namespace xsd = "http://www.w3.org/2001/XMLSchema"
namespace xsi = "http://www.w3.org/2001/XMLSchema-instance"

propertyExpression = xsd:string { pattern = "$\{[\w\.]+\}" }
[
  a:documentation [
    "\x{a}" ~
    "\x{a}" ~
    "   "
    xsd:documentation [
      "Extension to standard XSD boolean type to allow ${} parameters"
    ]
    "\x{a}" ~
    "\x{a}" ~
    "  "
  ]
]
booleanExp = xsd:boolean | propertyExpression
[
  a:documentation [
    "\x{a}" ~
    "\x{a}" ~
    "   "
    xsd:documentation [
      "Extension to standard XSD integer type to allow ${} parameters"
    ]
    "\x{a}" ~
    "\x{a}" ~
    "  "
  ]
]
integerExp = xsd:integer | propertyExpression
[
  a:documentation [
    "\x{a}" ~
    "\x{a}" ~
    "   "
    xsd:documentation [
      "Extension to standard XSD long type to allow ${} parameters"
    ]
    "\x{a}" ~
    "\x{a}" ~
    "  "
  ]
]
longExp = xsd:long | propertyExpression
onChangeSetPreconditionErrorOrFail =
  "HALT" | "WARN" | "CONTINUE" | "MARK_RAN"
onChangeLogPreconditionErrorOrFail = "HALT" | "WARN"
onChangeLogPreconditionOnSqlOutput = "TEST" | "FAIL" | "IGNORE"
onChangeSetValidationFail = "HALT" | "MARK_RAN"
objectQuotingStrategy =
  "LEGACY" | "QUOTE_ALL_OBJECTS" | "QUOTE_ONLY_RESERVED_WORDS"
# This is the main (root) part of the xsd
start |= databaseChangeLog
databaseChangeLog =
  element databaseChangeLog {
    element property {
      attribute file { xsd:string }?,
      attribute name { xsd:string }?,
      attribute value { xsd:string }?,
      attribute dbms { xsd:string }?,
      attribute context { xsd:string }?,
      attribute labels { xsd:string }?,
      attribute global { xsd:boolean }?
    }*,
    element preConditions {
      (PreConditionChildren+),
      attribute onFailMessage { xsd:string }?,
      attribute onErrorMessage { xsd:string }?,
      attribute onFail { onChangeLogPreconditionErrorOrFail }?,
      attribute onError { onChangeLogPreconditionErrorOrFail }?,
      attribute onSqlOutput { onChangeLogPreconditionOnSqlOutput }?
    }?,
    (element changeSet {
       element validCheckSum { comment? }*,
       [
         a:documentation [
           "\x{a}" ~
           "\x{a}" ~
           "          "
           xsd:documentation [
             "onChangeLogPreconditionOnSqlOutput determines what should happen when evaluating this precondition in updateSQL mode.  TEST: Run precondition, FAIL: Fail precondition, IGNORE: Skip precondition check [DEFAULT]"
           ]
           "\x{a}" ~
           "\x{a}" ~
           "         "
         ]
       ]
       element preConditions {
         (PreConditionChildren+),
         attribute onFailMessage { xsd:string }?,
         attribute onErrorMessage { xsd:string }?,
         attribute onFail { onChangeSetPreconditionErrorOrFail }?,
         attribute onError { onChangeSetPreconditionErrorOrFail }?,
         attribute onSqlOutput { onChangeLogPreconditionOnSqlOutput }?
       }?,
       (tagDatabase | changeSetChildren*),
       element modifySql {
         (modifySqlChildren+),
         attribute dbms { xsd:string }?,
         attribute context { xsd:string }?,
         attribute labels { xsd:string }?,
         attribute applyToRollback { booleanExp }?
       }*,
       changeSetAttributes
     }*
     | # include
       element include {
         attribute file { xsd:string },
         attribute relativeToChangelogFile { booleanExp }?,
         attribute context { xsd:string }?
       }*
     | element includeAll {
         attribute path { xsd:string },
         [ ns_1:defaultValue = "false" ]
         attribute errorIfMissingOrEmpty { booleanExp }?,
         attribute relativeToChangelogFile { booleanExp }?,
         attribute resourceComparator { xsd:string }?,
         attribute filter { xsd:string }?,
         attribute context { xsd:string }?
       }*)*,
    changeLogAttributes
  }
modifySqlChildren =
  element replace {
    attribute replace { xsd:string },
    attribute with { xsd:string }
  }*
  | element regExpReplace {
      attribute replace { xsd:string },
      attribute with { xsd:string }
    }*
  | element prepend {
      attribute value { xsd:string }
    }*
  | element append {
      attribute value { xsd:string }
    }*
# Attributes for DatabaseInfo
DatabaseInfoAttributes =
  attribute type { xsd:string }?,
  attribute version { xsd:string }?,
  attribute username { xsd:string }?,
  attribute password { xsd:string }?,
  attribute port { integerExp }?,
  attribute host { xsd:string }?,
  attribute schemaName { xsd:string }?,
  attribute driverName { xsd:string }?
# Attributes for changeSet
changeLogAttributes =
  attribute logicalFilePath { xsd:string }?,
  attribute context { xsd:string }?,
  [ ns_1:defaultValue = "LEGACY" ]
  attribute objectQuotingStrategy { objectQuotingStrategy }?,
  attribute xsi:schemaLocation { xsd:string }?
# Attributes for changeSet
changeSetAttributes =
  attribute id { xsd:string },
  attribute author { xsd:string },
  attribute context { xsd:string }?,
  attribute labels { xsd:string }?,
  attribute dbms { xsd:string }?,
  attribute runOnChange { booleanExp }?,
  attribute runAlways { booleanExp }?,
  attribute failOnError { booleanExp }?,
  attribute onValidationFail { onChangeSetValidationFail }?,
  [ ns_1:defaultValue = "true" ]
  attribute runInTransaction { booleanExp }?,
  attribute logicalFilePath { xsd:string }?,
  attribute objectQuotingStrategy { objectQuotingStrategy }?,
  attribute created { xsd:string }?,
  attribute runOrder { xsd:string }?
# Attributes for constraints
constraintsAttributes =
  attribute nullable { booleanExp }?,
  attribute primaryKey { booleanExp }?,
  attribute primaryKeyName { xsd:string }?,
  attribute primaryKeyTablespace { xsd:string }?,
  attribute unique { booleanExp }?,
  attribute uniqueConstraintName { xsd:string }?,
  attribute references { xsd:string }?,
  attribute referencedTableCatalogName { xsd:string }?,
  attribute referencedTableSchemaName { xsd:string }?,
  attribute referencedTableName { xsd:string }?,
  attribute referencedColumnNames { xsd:string }?,
  attribute foreignKeyName { xsd:string }?,
  attribute deleteCascade { booleanExp }?,
  attribute deferrable { booleanExp }?,
  attribute initiallyDeferred { booleanExp }?,
  attribute checkConstraint { xsd:string }?
columnAttributes =
  attribute name { xsd:string }?,
  attribute computed { booleanExp }?,
  attribute type { xsd:string }?,
  attribute value { xsd:string }?,
  attribute valueNumeric { xsd:string }?,
  attribute valueBoolean { xsd:string }?,
  attribute valueDate { xsd:string }?,
  attribute valueComputed { xsd:string }?,
  attribute valueSequenceCurrent { xsd:string }?,
  attribute valueSequenceNext { xsd:string }?,
  attribute valueBlobFile { xsd:string }?,
  attribute valueClobFile { xsd:string }?,
  attribute defaultValue { xsd:string }?,
  attribute defaultValueNumeric { xsd:string }?,
  attribute defaultValueDate { xsd:string }?,
  attribute defaultValueBoolean { booleanExp }?,
  attribute defaultValueComputed { xsd:string }?,
  attribute defaultValueSequenceCurrent { xsd:string }?,
  attribute defaultValueSequenceNext { xsd:string }?,
  attribute autoIncrement { booleanExp }?,
  attribute startWith { longExp }?,
  attribute incrementBy { longExp }?,
  attribute remarks { xsd:string }?,
  attribute encoding {
    [
      a:documentation [
        "\x{a}" ~
        "\x{a}" ~
        "      "
        xsd:documentation [
          "\x{a}" ~
          "       Used with valueClobFile to specify file encoding explicitly.\x{a}" ~
          "      "
        ]
        "\x{a}" ~
        "\x{a}" ~
        "     "
      ]
    ]
    xsd:string
  }?
columnType =
  constraints?,
  element * { text }*,
  column
paramAttributes =
  attribute name { xsd:string }?,
  attribute value { xsd:string }?,
  attribute valueNumeric { xsd:string }?,
  attribute valueBoolean { xsd:string }?,
  attribute valueDate { xsd:string }?,
  attribute valueComputed { xsd:string }?,
  attribute valueSequenceNext { xsd:string }?,
  attribute valueSequenceCurrent { xsd:string }?
tableNameAttribute =
  attribute catalogName { xsd:string }?,
  attribute schemaName { xsd:string }?,
  attribute tableName { xsd:string }
dropTableAttributes =
  tableNameAttribute,
  attribute cascadeConstraints { booleanExp }?
renameTableAttributes =
  attribute catalogName { xsd:string }?,
  attribute schemaName { xsd:string }?,
  attribute oldTableName { xsd:string },
  attribute newTableName { xsd:string }
renameViewAttributes =
  attribute catalogName { xsd:string }?,
  attribute schemaName { xsd:string }?,
  attribute oldViewName { xsd:string },
  attribute newViewName { xsd:string }
renameColumnAttributes =
  tableNameAttribute,
  attribute oldColumnName { xsd:string },
  attribute newColumnName { xsd:string },
  attribute columnDataType { xsd:string }?,
  attribute remarks { xsd:string }?
dropColumnAttributes =
  tableNameAttribute,
  attribute columnName { xsd:string }?
sequenceAttributes =
  attribute catalogName { xsd:string }?,
  attribute schemaName { xsd:string }?,
  attribute sequenceName { xsd:string },
  attribute startValue { xsd:string }?,
  attribute incrementBy { xsd:string }?,
  attribute maxValue { xsd:string }?,
  attribute minValue { xsd:string }?,
  attribute ordered { booleanExp }?,
  attribute cacheSize { xsd:nonNegativeInteger }?,
  attribute cycle {
    booleanExp
    >> a:documentation [
         "\x{a}" ~
         "\x{a}" ~
         "     true for a cycling sequence, false for a non-cycling sequence.\x{a}" ~
         "     Default is false.\x{a}" ~
         "\x{a}" ~
         "    "
       ]
  }?
renameSequenceAttributes =
  attribute catalogName { xsd:string }?,
  attribute schemaName { xsd:string }?,
  attribute oldSequenceName { xsd:string },
  attribute newSequenceName { xsd:string }
indexName = attribute indexName { xsd:string }
createIndexAttributes =
  tableNameAttribute,
  indexName,
  attribute associatedWith { xsd:string }?,
  attribute unique { booleanExp }?,
  attribute clustered { booleanExp }?,
  attribute tablespace { xsd:string }?
start |= addPrimaryKey
addPrimaryKey =
  element addPrimaryKey {
    (element * { text }*)+,
    tableNameAttribute,
    attribute columnNames { xsd:string },
    attribute constraintName { xsd:string }?,
    attribute tablespace { xsd:string }?,
    attribute clustered { booleanExp }?,
    attribute forIndexCatalogName { xsd:string }?,
    attribute forIndexSchemaName { xsd:string }?,
    attribute forIndexName { xsd:string }?
  }
start |= dropPrimaryKey
dropPrimaryKey =
  element dropPrimaryKey {
    tableNameAttribute,
    attribute constraintName { xsd:string }?
  }
start |= addUniqueConstraint
addUniqueConstraint =
  element addUniqueConstraint {
    tableNameAttribute,
    attribute columnNames { xsd:string },
    attribute constraintName { xsd:string }?,
    attribute tablespace { xsd:string }?,
    attribute disabled { booleanExp }?,
    attribute deferrable { booleanExp }?,
    attribute initiallyDeferred { booleanExp }?,
    attribute forIndexCatalogName { xsd:string }?,
    attribute forIndexSchemaName { xsd:string }?,
    attribute forIndexName { xsd:string }?
  }
start |= dropUniqueConstraint
dropUniqueConstraint =
  element dropUniqueConstraint {
    tableNameAttribute,
    attribute constraintName { xsd:string }?,
    attribute uniqueColumns { xsd:string }?
  }
start |= modifyDataType
modifyDataType =
  element modifyDataType {
    tableNameAttribute,
    attribute columnName { xsd:string },
    attribute newDataType { xsd:string }
  }
start |= addLookupTable
addLookupTable =
  element addLookupTable {
    attribute existingTableCatalogName { xsd:string }?,
    attribute existingTableSchemaName { xsd:string }?,
    attribute existingTableName { xsd:string },
    attribute existingColumnName { xsd:string },
    attribute newTableCatalogName { xsd:string }?,
    attribute newTableSchemaName { xsd:string }?,
    attribute newTableName { xsd:string },
    attribute newColumnName { xsd:string },
    attribute newColumnDataType { xsd:string }?,
    attribute constraintName { xsd:string }?
  }
start |= addAutoIncrement
addAutoIncrement =
  element addAutoIncrement {
    tableNameAttribute,
    attribute columnName { xsd:string },
    attribute columnDataType { xsd:string }?,
    attribute startWith { longExp }?,
    attribute incrementBy { longExp }?
  }
start |= addDefaultValue
addDefaultValue =
  element addDefaultValue {
    tableNameAttribute,
    attribute columnName { xsd:string },
    attribute columnDataType { xsd:string }?,
    attribute defaultValue { xsd:string }?,
    attribute defaultValueNumeric { xsd:string }?,
    attribute defaultValueDate { xsd:string }?,
    attribute defaultValueBoolean { xsd:string }?,
    attribute defaultValueComputed { xsd:string }?,
    attribute defaultValueSequenceNext { xsd:string }?
  }
start |= dropDefaultValue
dropDefaultValue =
  element dropDefaultValue {
    tableNameAttribute,
    attribute columnName { xsd:string },
    attribute columnDataType { xsd:string }?
  }
start |= loadData
loadData =
  element loadData {
    element column {
      attribute index { integerExp }?,
      attribute header { xsd:string }?,
      attribute name { xsd:string }?,
      attribute type { xsd:string }?,
      attribute defaultValue { xsd:string }?,
      attribute defaultValueNumeric { xsd:string }?,
      attribute defaultValueDate { xsd:string }?,
      attribute defaultValueBoolean { booleanExp }?,
      attribute defaultValueComputed { xsd:string }?
    }*,
    tableNameAttribute,
    attribute file { xsd:string }?,
    attribute relativeToChangelogFile { booleanExp }?,
    [ ns_1:defaultValue = "UTF-8" ] attribute encoding { xsd:string }?,
    [ ns_1:defaultValue = "," ] attribute separator { xsd:string }?,
    [ ns_1:defaultValue = '"' ] attribute quotchar { xsd:string }?,
    [ ns_1:defaultValue = "#" ]
    attribute commentLineStartsWith { xsd:string }?
  }
start |= loadUpdateData
loadUpdateData =
  element loadUpdateData {
    element column {
      attribute index { integerExp }?,
      attribute header { xsd:string }?,
      attribute name { xsd:string }?,
      attribute type { xsd:string }?,
      attribute defaultValue { xsd:string }?,
      attribute defaultValueNumeric { xsd:string }?,
      attribute defaultValueDate { xsd:string }?,
      attribute defaultValueBoolean { booleanExp }?,
      attribute defaultValueComputed { xsd:string }?
    }*,
    tableNameAttribute,
    attribute file { xsd:string }?,
    attribute relativeToChangelogFile { booleanExp }?,
    [ ns_1:defaultValue = "UTF-8" ] attribute encoding { xsd:string }?,
    attribute primaryKey { xsd:string },
    [ ns_1:defaultValue = "false" ]
    attribute onlyUpdate { xsd:boolean }?,
    [ ns_1:defaultValue = "," ] attribute separator { xsd:string }?,
    [ ns_1:defaultValue = '"' ] attribute quotchar { xsd:string }?
  }
fkCascadeActionOptions =
  "CASCADE" | "SET NULL" | "SET DEFAULT" | "RESTRICT" | "NO ACTION"
addForeignKeyConstraintAttrib =
  attribute baseTableCatalogName { xsd:string }?,
  attribute baseTableSchemaName { xsd:string }?,
  attribute baseTableName { xsd:string },
  attribute baseColumnNames { xsd:string },
  attribute constraintName { xsd:string },
  attribute referencedTableCatalogName { xsd:string }?,
  attribute referencedTableSchemaName { xsd:string }?,
  attribute referencedTableName { xsd:string },
  attribute referencedColumnNames { xsd:string },
  attribute deferrable { booleanExp }?,
  attribute initiallyDeferred { booleanExp }?,
  attribute deleteCascade { booleanExp }?,
  attribute onDelete { fkCascadeActionOptions }?,
  attribute onUpdate { fkCascadeActionOptions }?,
  attribute referencesUniqueColumn { booleanExp }?
addNotNullConstraintAttrib =
  tableNameAttribute,
  attribute columnName { xsd:string },
  attribute defaultNullValue { xsd:string }?,
  attribute columnDataType { xsd:string }?,
  attribute constraintName { xsd:string }?
start |= addNotNullConstraint
addNotNullConstraint =
  element addNotNullConstraint { addNotNullConstraintAttrib }
start |= addForeignKeyConstraint
addForeignKeyConstraint =
  element addForeignKeyConstraint { addForeignKeyConstraintAttrib }
dbmsAttrib = attribute type { xsd:string }
start |= dbms
dbms = element dbms { dbmsAttrib }
start |= changeSetExecuted
changeSetExecuted =
  element changeSetExecuted {
    attribute id { xsd:string },
    attribute author { xsd:string },
    attribute changeLogFile { xsd:string }?
  }
start |= tableExists
tableExists =
  element tableExists {
    attribute catalogName { xsd:string }?,
    attribute schemaName { xsd:string }?,
    attribute tableName { xsd:string }
  }
start |= columnExists
columnExists =
  element columnExists {
    attribute catalogName { xsd:string }?,
    attribute schemaName { xsd:string }?,
    attribute tableName { xsd:string },
    attribute columnName { xsd:string }
  }
start |= sequenceExists
sequenceExists =
  element sequenceExists {
    attribute catalogName { xsd:string }?,
    attribute schemaName { xsd:string }?,
    attribute sequenceName { xsd:string }
  }
start |= foreignKeyConstraintExists
foreignKeyConstraintExists =
  element foreignKeyConstraintExists {
    attribute catalogName { xsd:string }?,
    attribute schemaName { xsd:string }?,
    attribute foreignKeyTableName { xsd:string }?,
    attribute foreignKeyName { xsd:string }?
  }
start |= indexExists
indexExists =
  element indexExists {
    attribute catalogName { xsd:string }?,
    attribute schemaName { xsd:string }?,
    attribute indexName { xsd:string }?,
    attribute tableName { xsd:string }?,
    attribute columnNames { xsd:string }?
  }
start |= rowCount
rowCount =
  element rowCount {
    attribute catalogName { xsd:string }?,
    attribute schemaName { xsd:string }?,
    attribute tableName { xsd:string }?,
    attribute expectedRows { xsd:int }?
  }
start |= tableIsEmpty
tableIsEmpty =
  element tableIsEmpty {
    attribute catalogName { xsd:string }?,
    attribute schemaName { xsd:string }?,
    attribute tableName { xsd:string }?
  }
start |= changeLogPropertyDefined
changeLogPropertyDefined =
  element changeLogPropertyDefined {
    attribute property { xsd:string },
    attribute value { xsd:string }?
  }
start |= primaryKeyExists
primaryKeyExists =
  element primaryKeyExists {
    attribute catalogName { xsd:string }?,
    attribute schemaName { xsd:string }?,
    attribute primaryKeyName { xsd:string }?,
    attribute tableName { xsd:string }?
  }
start |= viewExists
viewExists =
  element viewExists {
    attribute catalogName { xsd:string }?,
    attribute schemaName { xsd:string }?,
    attribute viewName { xsd:string }
  }
start |= sqlCheck
sqlCheck =
  element sqlCheck {
    attribute expectedResult { xsd:string }
  }
start |= customPrecondition
customPrecondition =
  element customPrecondition {
    element param {
      attribute name { xsd:string },
      attribute value { xsd:string }
    }*,
    attribute className { xsd:string }
  }
start |= and
and = element and { PreConditionChildren+ }
start |= or
or = element or { PreConditionChildren+ }
start |= not
not = element not { PreConditionChildren+ }
runningAsAttrib = attribute username { xsd:string }
start |= runningAs
runningAs = element runningAs { runningAsAttrib }
objectQuotingStrategyAttrib = attribute strategy { xsd:string }
start |= expectedQuotingStrategy
expectedQuotingStrategy =
  element expectedQuotingStrategy { objectQuotingStrategyAttrib }
dropForeignKeyConstraintAttrib =
  attribute baseTableCatalogName { xsd:string }?,
  attribute baseTableSchemaName { xsd:string }?,
  attribute baseTableName { xsd:string },
  attribute constraintName { xsd:string }?
start |= dropForeignKeyConstraint
dropForeignKeyConstraint =
  element dropForeignKeyConstraint { dropForeignKeyConstraintAttrib }
dropAllForeignKeyConstraintsAttrib =
  attribute baseTableCatalogName { xsd:string }?,
  attribute baseTableSchemaName { xsd:string }?,
  attribute baseTableName { xsd:string }
start |= dropAllForeignKeyConstraints
dropAllForeignKeyConstraints =
  element dropAllForeignKeyConstraints {
    dropAllForeignKeyConstraintsAttrib
  }
start |= dropNotNullConstraint
dropNotNullConstraint =
  element dropNotNullConstraint {
    attribute catalogName { xsd:string }?,
    attribute schemaName { xsd:string }?,
    attribute tableName { xsd:string },
    attribute columnName { xsd:string },
    attribute columnDataType { xsd:string }?
  }
start |= setTableRemarks
setTableRemarks =
  element setTableRemarks {
    attribute catalogName { xsd:string }?,
    attribute schemaName { xsd:string }?,
    attribute tableName { xsd:string },
    attribute remarks { xsd:string }?
  }
start |= setColumnRemarks
setColumnRemarks =
  element setColumnRemarks {
    attribute catalogName { xsd:string }?,
    attribute schemaName { xsd:string }?,
    attribute tableName { xsd:string },
    attribute columnName { xsd:string },
    attribute remarks { xsd:string }?
  }
start |= constraints
constraints = element constraints { constraintsAttributes }
start |= column
column =
  element column {
    columnAttributes,
    constraints?
  }
start |= param
param = element param { paramAttributes, param }
# Children for createTable
start |= createTable
createTable =
  element createTable {
    (column+
     | element * { text }*)+,
    tableNameAttribute,
    attribute tablespace { xsd:string }?,
    attribute remarks { xsd:string }?
  }
# Children for createView
start |= createView
createView =
  element createView {
    attribute catalogName { xsd:string },
    attribute schemaName { xsd:string },
    attribute viewName { xsd:string },
    attribute replaceIfExists { booleanExp },
    attribute fullDefinition { booleanExp }
  }
# Children for insert
start |= insert
insert =
  element insert {
    column+,
    tableNameAttribute,
    attribute dbms { xsd:string }?
  }
start |= update
update =
  element update {
    column+,
    element where { text }?,
    whereParams?,
    tableNameAttribute
  }
start |= whereParams
whereParams = element whereParams { param+ }
start |= delete
delete =
  element delete {
    element where { text }?,
    whereParams?,
    tableNameAttribute
  }
# Children for addColum
start |= addColumn
addColumn =
  element addColumn {
    element column {
      columnAttributes,
      attribute beforeColumn { xsd:string }?,
      attribute afterColumn { xsd:string }?,
      attribute position { xsd:integer }?
    }+,
    tableNameAttribute
  }
start |= rollback
rollback =
  element rollback {
    (changeSetChildren*),
    attribute changeSetPath { xsd:string }?,
    attribute changeSetAuthor { xsd:string }?,
    attribute changeSetId { xsd:string }?
  }
# comment
start |= comment
comment = element comment { xsd:string }
# sql
start |= sql
sql =
  element sql {
    comment?,
    attribute stripComments { booleanExp }?,
    attribute splitStatements { booleanExp }?,
    attribute endDelimiter { xsd:string }?,
    attribute dbms { xsd:string }?
  }
start |= createProcedure
createProcedure =
  element createProcedure {
    comment?,
    attribute catalogName { xsd:string }?,
    attribute schemaName { xsd:string }?,
    attribute procedureName { xsd:string }?,
    attribute path { xsd:string }?,
    attribute encoding { xsd:string }?,
    attribute relativeToChangelogFile { booleanExp }?,
    attribute dbms { xsd:string }?,
    attribute replaceIfExists { xsd:boolean }?
  }
start |= executeCommand
executeCommand =
  element executeCommand {
    element arg {
      attribute value { xsd:string }
    }*,
    attribute executable { xsd:string },
    attribute os { xsd:string }?
  }
start |= sqlFile
sqlFile =
  element sqlFile {
    attribute path { xsd:string },
    attribute stripComments { booleanExp }?,
    attribute splitStatements { booleanExp }?,
    [ ns_1:defaultValue = "UTF-8" ] attribute encoding { xsd:string }?,
    attribute endDelimiter { xsd:string }?,
    attribute relativeToChangelogFile { booleanExp }?,
    attribute dbms { xsd:string }?
  }
start |= tagDatabase
tagDatabase =
  element tagDatabase {
    attribute tag { xsd:string }
  }
start |= stop
stop = element stop { empty }
start |= \empty
\empty = element empty { empty }
start |= output
output =
  element output {
    attribute target { xsd:string }?
  }
# renameTable
start |= renameTable
renameTable = element renameTable { renameTableAttributes }
start |= renameView
renameView = element renameView { renameViewAttributes }
# dropTable
start |= dropTable
dropTable = element dropTable { dropTableAttributes }
start |= dropView
dropView =
  element dropView {
    attribute viewName { xsd:string },
    attribute catalogName { xsd:string }?,
    attribute schemaName { xsd:string }?
  }
start |= dropProcedure
dropProcedure =
  element dropProcedure {
    attribute procedureName { xsd:string },
    attribute catalogName { xsd:string }?,
    attribute schemaName { xsd:string }?
  }
# renameColumn
start |= renameColumn
renameColumn = element renameColumn { renameColumnAttributes }
start |= dropColumn
dropColumn =
  element dropColumn {
    element column { columnType }*,
    dropColumnAttributes
  }
start |= mergeColumns
mergeColumns =
  element mergeColumns {
    tableNameAttribute,
    attribute column1Name { xsd:string },
    attribute joinString { xsd:string },
    attribute column2Name { xsd:string },
    attribute finalColumnName { xsd:string },
    attribute finalColumnType { xsd:string }
  }
start |= createSequence
createSequence = element createSequence { sequenceAttributes }
start |= alterSequence
alterSequence = element alterSequence { sequenceAttributes }
start |= dropSequence
dropSequence = element dropSequence { sequenceAttributes }
start |= renameSequence
renameSequence = element renameSequence { renameSequenceAttributes }
start |= createIndex
createIndex =
  element createIndex {
    createIndexAttributes,
    (column+ | element * { text }*)+
  }
start |= dropIndex
dropIndex =
  element dropIndex {
    tableNameAttribute,
    indexName,
    attribute associatedWith { xsd:string }?
  }
start |= customChange
customChange =
  element customChange {
    element param {
      attribute name { xsd:string },
      attribute value { xsd:string }?
    }*,
    attribute class { xsd:string }
  }
# Children for changeSet
changeSetChildren =
  comment
  | createTable+
  | dropTable+
  | createView+
  | renameView+
  | dropView+
  | insert+
  | addColumn+
  | sql+
  | createProcedure+
  | dropProcedure+
  | sqlFile+
  | renameTable+
  | renameColumn+
  | dropColumn+
  | mergeColumns+
  | modifyDataType+
  | createSequence+
  | alterSequence+
  | dropSequence+
  | renameSequence+
  | createIndex+
  | dropIndex+
  | addNotNullConstraint+
  | dropNotNullConstraint+
  | addForeignKeyConstraint+
  | dropForeignKeyConstraint+
  | dropAllForeignKeyConstraints+
  | addPrimaryKey+
  | dropPrimaryKey+
  | addLookupTable+
  | addAutoIncrement+
  | addDefaultValue+
  | dropDefaultValue+
  | addUniqueConstraint+
  | dropUniqueConstraint+
  | setTableRemarks+
  | setColumnRemarks+
  | customChange+
  | update+
  | delete+
  | loadData+
  | loadUpdateData+
  | executeCommand+
  | stop+
  | output+
  | \empty+
  | rollback
  | element * { text }*
# Children for Precondition
PreConditionChildren =
  and+
  | or+
  | not+
  | dbms+
  | runningAs+
  | changeSetExecuted+
  | tableExists+
  | columnExists+
  | sequenceExists+
  | foreignKeyConstraintExists+
  | indexExists+
  | primaryKeyExists+
  | viewExists+
  | tableIsEmpty+
  | rowCount+
  | sqlCheck+
  | changeLogPropertyDefined+
  | expectedQuotingStrategy+
  | customPrecondition+
  | element * { text }*
